package com.interview;

import com.interview.communication.*;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("========== Java 线程通信示例 ==========\n");

        // 示例1: wait/notify 方式
        System.out.println("【示例1】wait/notify 方式:");
        WaitNotifyExample.demo();

        System.out.println("\n" + "=".repeat(50) + "\n");

        // 示例2: volatile + synchronized 共享变量
        System.out.println("【示例2】volatile + synchronized 共享变量:");
        SharedVariableExample.demo();

        System.out.println("\n" + "=".repeat(50) + "\n");

        // 示例3: BlockingQueue 阻塞队列
        System.out.println("【示例3】BlockingQueue 生产者-消费者:");
        BlockingQueueExample.demo();

        System.out.println("\n" + "=".repeat(50) + "\n");

        // 示例4: Lock + Condition 
        System.out.println("【示例4】Lock + Condition:");
        LockConditionExample.demo();
    }
}